<table class="paginator" width="100%" cellspacing="0" cellpadding="0"
       <?php if (!$pager->haveToPaginate()): ?> style="display: none;" <?php endif; ?>>
  <?php $params = array_merge($params, array('max' => 'max_per_page=js')) ?>
  <tr>
    <td width="100%" style="text-align: center;">Page </td>
  </tr>
  
  <tr>
    <td width="100%" style="text-align: center;">
    <?php $links = count($pager->getLinks(11)) ?>
    <?php if (10 < $links): ?>
      <?php echo link_to_get_url('&laquo;', $uri, array_merge($params, array('page' => $pager->getFirstPage())) ) ?>
      <?php echo link_to_get_url('&lt;'   , $uri, array_merge($params, array('page' => $pager->getPreviousPage())) ) ?>
    <?php endif; ?>
    
      <?php foreach ($pager->getLinks(10) as $page): ?>
        <?php echo $page == $pager->getPage() ? sprintf('<i style="font-style: normal; color: #FF0000;"><b>%s</b></i>', $page) 
                                              : link_to_get_url($page, $uri, array_merge($params, array('page' => $page)) ) ?>
        <?php if ($page != $pager->getCurrentMaxLink()): ?> | <?php endif; ?>
      <?php endforeach; ?>
    
      <?php if (10 < $links): ?>
        <?php echo link_to_get_url('&gt;'   , $uri, array_merge($params, array('page' => $pager->getNextPage())) ) ?>
        <?php echo link_to_get_url('&raquo;', $uri, array_merge($params, array('page' => $pager->getLastPage())) ) ?>
    <?php endif; ?>
    </td>
  </tr>
</table>

<table class="paginator" width="100%" cellspacing="0" cellpadding="0"
       <?php if (!$pager->haveToPaginate() && $sf_params->get('max') == '10'): ?> style="display: none;" <?php endif; ?>>
  <tr>
    <td width="100%" style="text-align: center;">
      <input type="hidden" id="page" id="page" value="<?php echo $pager->getPage() ?>" size="2" maxlength="3" />
      <label for="max_per_page">Numero de Registros Mostrados:</label>
      <?php echo select_tag('max_per_page', 
                            array(
                                   '10'  => '10', 
                                   '20'  => '20', 
                                   '30'  => '30', 
                                   '50'  => '50', 
                                   '100' => '100'
                                 ), 
                            $sf_params->get('max'), 
                            array('onchange' => get_url($uri, $params))
        ) ?>
    </td>
  </tr>
</table>
